package com.ytc.restcontroller;

import com.ytc.mapper.TypeMapper;
import com.ytc.model.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TypeServiceImpl {
    @Autowired
    private TypeMapper typeMapper;

    //柴晓颖：去新增书籍时查询书籍类型
    @RequestMapping("queryBookType")
    public List<Type> queryBookType(){
        return typeMapper.queryBookType();
    }

    //柴晓颖：查询小类型
    @RequestMapping("getSmallType")
    public List<Type> getSmallType(@RequestParam("pid")Integer pid){
        return typeMapper.getSmallType(pid);
    }

    //张阔： 查询频道
    @RequestMapping("queryBigTypeList")
    public List<Type> queryBigTypeList(){
        return typeMapper.queryBigTypeList();
    }

    //张阔： 查询书籍类型
    @RequestMapping("querySmallTypeList")
    public List<Type> querySmallTypeList(@RequestParam("pid") Integer pid){
        return typeMapper.querySmallTypeList(pid);
    }


}
